<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2018/6/7
  Time: 16:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>

<body>
<%
    String name = "";
    String pwd = "";
    if (request.getCookies()!=null){
        Cookie[] cookies = request.getCookies();
        for (Cookie c:cookies){
//            System.out.println(c.getName()+"================"+c.getValue());
            if (c.getName().equals( "uname" )){
                name=c.getValue();
            }
            if(c.getName().equals( "upwd" )){
                pwd=c.getValue();
            }
        }
    }
%>
<form action="LoginCookieServlet"  method="get" >
    <table>
        <tr>
            <td>用户名</td>
            <td><input type="text" id="name" name="name" value="<%=name%>"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input type="password" id="pwd" name="pwd" value="<%=pwd%>"></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="登陆"></td>
        </tr>
    </table>
</form>
</body>
</html>
